<#-- 导入变量定义文件 -->
<#include "../template/include/assign.ftl">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>客户管理</title>
<#-- 导入静态资源文件 -->
<#include "../template/include/source.ftl">
<link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	.page{
		float:right;
		padding-top: 15px;
		margin-right: 15px;
	}
</style>
</head>
<#include "../template/template_listPage.ftl">
<script type="text/javascript">
	$().ready( function() {
		<#if actionErrors??&&(actionErrors?size > 0)>
			$.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
			 modal: true, autoCloseTime: 3000});
		</#if>
		<#if actionMessages??&&(actionMessages?size > 0)>
			$.dialog({type: "success", content: "<#list actionMessages as list>${list}<br></#list>",
			 modal: true, autoCloseTime: 5000});
		</#if>
		
		$('.follow-cursor').poshytip({
                    className: 'tip-darkgray',
	                followCursor: true,
	                slide: false
                });
	
	});
  
  
</script>
</head>
<body class="list">
	<div class="body">
		<div class="listBar">
			<h1><span class="icon">&nbsp;</span>客户管理&nbsp;<span class="pageInfo"></span></h1>
		</div>
		<@pageList page=(page!) id="listForm" action="${web_base}/go/customer!list.htm" query="customerInfoQuery" isEmpty=true>
			<div class="operateBar">
					
			  客户昵称:<input type="text" id="customerNick" name="customerInfoQuery.customerNick" value="${(customerInfoQuery.customerNick)!}"> 
			  手机号码:<input type="text" id="mobile" name="customerInfoQuery.mobile" value="${(customerInfoQuery.mobile)!}"> 
			<span>开始时间</span> <input type="text" id="startTime" name="customerInfoQuery.startTime"
                    onclick="WdatePicker({startDate:'%y',dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'endTime\')||\'%y-%M-%d\'}'})"
                           value="${(customerInfoQuery.startTime?string("yyyy-MM-dd HH:mm:ss"))!}" class="Wdate fixWidth" >
			<span>结束时间</span> <input type="text" id="endTime" name="customerInfoQuery.endTime"
                   onclick="WdatePicker({startDate:'%y',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'startTime\')}',maxDate:'%y-%M-%d'})"
                   value="${(customerInfoQuery.endTime?string("yyyy-MM-dd HH:mm:ss"))!}" class="Wdate fixWidth">
			选择客户状态:
				<select name="customerInfoQuery.status" id="status">
				    <option value="" >全部状态</option>
					<option value="2" <#if customerInfoQuery?? && customerInfoQuery.status?? && customerInfoQuery.status=="2">selected="selected"</#if> >正常离线</option>
				    <option value="1" <#if customerInfoQuery?? && customerInfoQuery.status?? && customerInfoQuery.status=="1">selected="selected"</#if> >正常在线</option>
					<option value="0" <#if customerInfoQuery?? && customerInfoQuery.status?? && customerInfoQuery.status=="0">selected="selected"</#if> >锁定</option>
				</select>
				<input type="hidden" name="customerInfoQuery.orderBy" id="orderBy" value="${customerInfoQuery.orderBy}" />
				<input type="hidden" name="customerInfoQuery.orderType" id="order" value="${customerInfoQuery.orderType}" />
				<input type="submit" id="searchButton" class="searchButton" value="" />
			</div>
			<table class="listTable">
				<tr>
					<th width="100">
						<span class="" name="cid">客户编号</span>
					</th>
					<th>
						<span class="" name="nick">客户昵称</span>
					</th>
					<th>
						<span class="" name="header">客户头像</span>
					</th>
					<th>
						<span class="" name="sex">性别</span>
					</th>
					<th>
						<span class="" name="mobile">手机号</span>
					</th>
					<th>
						<span class="" name="account">第三方账号</span>
					</th>
					<th>
						<span class="sort" name="register_time">注册时间</span>
					</th>
					<th>
						<span class="sort" name="last_login_time">最后登录时间</span>
					</th>
					<th>
						<span class="sort" name="customer_score">积分</span>
					</th>
					<th>
						<span class="" name="invitationCode">邀请码</span>
					</th>
					<th>
						<span>操  作</span>
					</th>
				</tr>
				<#if  page??&&page.list??&&(page.list?size gt 0) >			
				<#list page.list as obj>
					<tr>
						<td width="100">
							<a href="${web_base}/go/customer!detail.htm?customerId=${(obj.customerId)!}" title="详情">${(obj.customerId)!}</a>
						</td>
						<td>
							${(obj.customerNick)!}
						</td>
						<td>
							<img id="" width="80" height="50" src="${(web_customer_header+obj.headerPath)!}" style=" margin-left: 6px;"/>
						</td>
						<td>
			                <#if obj.sex?? && obj.sex=="1">
									男
							<#elseif obj.sex?? && obj.sex="0">
									女
							</#if>
						</td>
						<td>
							${(obj.mobile)!}
						</td>
						<td>
							<#-- 第三方账号类型（1：微信，2：QQ，3：微博） -->
							<#if obj.accountList?? >
	                        <#list obj.accountList as a>
	                           <#if a.accountType?? && a.accountType=="1">
									微信/
								</#if>
								<#if a.accountType?? && a.accountType="2">
									QQ/
								</#if>
								<#if a.accountType?? && a.accountType="3">
									微博
								</#if>
	                        </#list>
	                      </#if>
						</td>
						<td>
							<#if obj.registerTime?exists&&obj.registerTime?is_date>
								${((obj.registerTime)!)?string("yyyy-MM-dd HH:mm:ss")}
							</#if>
						</td>
						<td>
							<#if obj.lastLoginTime?exists&&obj.lastLoginTime?is_date>
								${((obj.lastLoginTime)!)?string("yyyy-MM-dd HH:mm:ss")}
							</#if>
						</td>
						<td>
							${((obj.customerScore)!)}
						</td>
						<td>
							${((obj.myInvitationCode)!)}
						</td>
						<td>
							<#if obj.status?? && obj.status!="0">
						    	<a href="${web_base}/go/customer!lock.htm?customerId=${(obj.customerId)!}" title="锁定">锁定</a>
							<#elseif obj.status?? && obj.status=="0">
						    	<a href="${web_base}/go/customer!unlock.htm?customerId=${(obj.customerId)!}" title="解除锁定">解除锁定</a>
							</#if>
						</td>
					</tr>
				</#list>
				<#else>
				    <tr><td colspan="18">
					<div class="noRecord">
						没有找到任何记录!
					</div>	
					</td>
					</tr>
				</#if>	
			</table>
 
		</@pageList>
	</div>
	
</body>
</html>